#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    char isbn[14];
    scanf("%s", isbn);
    int sum = 0;
    int i = 0;
    int j = 1;
    while (i < 11)
    {
        if (isbn[i] == '-')
            i++;
        sum += ((isbn[i]-'0') * j);
        j++;
        i++;
    }
    int n = sum % 11;
    if (isbn[12] == (n+'0') || (isbn[12] == 'X' && n == 10))
        printf("Right");
    else
    {
        if (n != 10)
            isbn[12] = (n+'0');
        if (n == 10)
            isbn[12] = 'X';
        for (i = 0; i < 13; i++)
            printf("%c", isbn[i]);
    }

    return 0;
}